<#include "default/common/head.html" />
<link rel="stylesheet" href="${reroot}/static/assets/css/comment.css"  >
<br>
<div class="of-content" style="clear: both;margin-top: 60px">
    <div class="of-crad" style="width: 900px;margin: 0 auto;">
        <@of.content site_id=site.site_id content_id=params.content_id>
            <h2 class="content-title"> ${content.title_name}</h2>
            <div class="content-inf">发布时间：${content.create_time}&nbsp;&nbsp; 作者：${content.author}&nbsp;&nbsp;浏览次数：<span
                    id="views">${content.clicks}</span>
            </div>
            <div class="content-txt">${content.content}</div>
        </@of.content>
    </div>
    <#if fieldDetail??>
        <!--显示自定义的表单--->
        <div class="of-crad" style="width: 900px;margin: 0 auto;">
            <#include "default/common/form.html" />
        </div>
        <!-- 评论-->
        <script src="${reroot}/static/lib/jquery-1.10.1.min.js"></script>
        <script src="${reroot}/static/assets/js/utile.js"></script>
        <script>
        layui.use(['form','carousel','element'], function () {
            var form = layui.form;
            //监听提交
            form.on('submit(save)', function(data) {
                utile.ajaxSubmit({"url":"${webroot}/api/v1/content/save.json",data:data.field}, function(data) {
                    if (data.code == '200') {
                        alert("数据提交成功");
                        location.reload(this);
                    } else {
                        alert(data.msg);
                    }
                })
                return false;
            });
        });
        </script>
</#if>

<#include "default/common/footer.html" />
</body>
</html>